package com.example.service;

import com.example.mapper.FlightMapper;
import com.example.pojo.DTO.FlightsDTO;
import com.example.pojo.FlightBean;
import com.example.pojo.Flights;
import com.example.pojo.VO.AirlinesVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class FlightService {
    @Autowired
    FlightMapper flightMapper;
    public List<Flights> getAllFightsInfo() {
        return flightMapper.getAllFightsInfo();
    }

    public Integer deleteFlightById(Integer id) {
        return flightMapper.deleteFlightById(id);
    }

    public Flights getFlightById(Integer id) {
        return flightMapper.getFlightById(id);
    }

    public Integer updateFlightById(FlightBean flightBean) {
        return flightMapper.updateFlightById(flightBean);
    }

    public Integer addFlight(FlightBean flightBean) {
        return flightMapper.addFlight(flightBean);

    }

    public List<AirlinesVO> getAirlinesName() {
        return  flightMapper.getAirlinesName();
    }

    public List<Flights> getFightsByCondition(FlightsDTO flightsDTO) {
        return flightMapper.getFightsByCondition(flightsDTO);
    }
}
